package com.resys.entity.po;

import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.Date;
import com.resys.entity.enums.DateTimePatternEnum;
import com.resys.utils.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;


/**
 * 
 */
public class User implements Serializable {


	/**
	 * 用户唯一标识
	 */

	private String userId;

	/**
	 * 
	 */
	private String username;

	/**
	 * 
	 */
	private String password;

	/**
	 * 
	 */
	private String realName;

	/**
	 * 0=admin, 1=staff, 2=customer
	 */
	private Integer role;

	/**
	 * 
	 */
	private String company;

	/**
	 * 
	 */

	private String phone;

	/**
	 * 0=正常，1=禁用
	 */
	private Integer accountStatus;

	/**
	 * 
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createdAt;


	public void setUserId(String userId){
		this.userId = userId;
	}

	public String getUserId(){
		return this.userId;
	}

	public void setUsername(String username){
		this.username = username;
	}

	public String getUsername(){
		return this.username;
	}

	public void setPassword(String password){
		this.password = password;
	}

	public String getPassword(){
		return this.password;
	}

	public void setRealName(String realName){
		this.realName = realName;
	}

	public String getRealName(){
		return this.realName;
	}

	public void setRole(Integer role){
		this.role = role;
	}

	public Integer getRole(){
		return this.role;
	}

	public void setCompany(String company){
		this.company = company;
	}

	public String getCompany(){
		return this.company;
	}

	public void setPhone(String phone){
		this.phone = phone;
	}

	public String getPhone(){
		return this.phone;
	}

	public void setAccountStatus(Integer accountStatus){
		this.accountStatus = accountStatus;
	}

	public Integer getAccountStatus(){
		return this.accountStatus;
	}

	public void setCreatedAt(Date createdAt){
		this.createdAt = createdAt;
	}

	public Date getCreatedAt(){
		return this.createdAt;
	}

	@Override
	public String toString (){
		return "用户唯一标识:"+(userId == null ? "空" : userId)+"，username:"+(username == null ? "空" : username)+"，password:"+(password == null ? "空" : password)+"，realName:"+(realName == null ? "空" : realName)+"，0=admin, 1=staff, 2=customer:"+(role == null ? "空" : role)+"，company:"+(company == null ? "空" : company)+"，phone:"+(phone == null ? "空" : phone)+"，0=正常，1=禁用:"+(accountStatus == null ? "空" : accountStatus)+"，createdAt:"+(createdAt == null ? "空" : DateUtil.format(createdAt, DateTimePatternEnum.YYYY_MM_DD_HH_MM_SS.getPattern()));
	}
}
